/**
* All Rights Reserved , Copyright (C) 2021 , 青岛鼎信通讯股份有限公司
*
* MmsPostAuthorizationInfoServiceAuto
* 岗位授权信息表新
*
* 修改纪录
* 2021-06-29 版本：1.0 hudeyong 创建。
* @version 版本：1.0
* @author 作者：hudeyong
* 创建日期：2021-06-29
*/

package com.topscomm.mms.service.impl.auto;

import javax.annotation.Resource;
import com.topscomm.basic.IBasicDao;
import com.topscomm.tap.common.DatacodeCache;
import java.util.Map;
import com.topscomm.mms.*;
import com.topscomm.mms.pojo.MmsPostAuthorizationInfoEntity;
import com.topscomm.mms.dao.IMmsPostAuthorizationInfoDao;


public class MmsPostAuthorizationInfoServiceAuto extends MmsService<MmsPostAuthorizationInfoEntity,IMmsPostAuthorizationInfoDao> {

	/**
	 * @author: hudeyong
	 * @date: 2021-06-29
	 * @param mapRow
	 * @description:设置字段显示值
	 * @modify:
	 */
	@Override
	public void setDispFields(Map<String, Object> mapRow, DatacodeCache datacodeCache) {
		String temp;
		if (mapRow.get("deptcommoncode") != null) {
			temp = mapRow.get("deptcommoncode").toString();
			mapRow.put("dispdeptcommoncode", datacodeCache.getValueDynamic("PostDeptCommonCode", temp, "code", "name"));
		}
		if (mapRow.get("postcode") != null) {
			temp = mapRow.get("postcode").toString();
			mapRow.put("disppostcode", datacodeCache.getValueDynamic("PostCode", temp, "code", "name"));
		}
		if (mapRow.get("usercode") != null) {
			temp = mapRow.get("usercode").toString();
			mapRow.put("dispusercode", datacodeCache.getValueDynamic("CboUser", temp, "code", "name"));
		}
		if (mapRow.get("visibledeptcommoncodetype") != null) {
			temp = mapRow.get("visibledeptcommoncodetype").toString();
			mapRow.put("dispvisibledeptcommoncodetype", datacodeCache.getValueDynamic("VisualDeptType", temp, "code", "name"));
		}
		if (mapRow.get("visibledeptcommoncoderange") != null) {
			temp = mapRow.get("visibledeptcommoncoderange").toString();
			mapRow.put("dispvisibledeptcommoncoderange", datacodeCache.getValueDynamic("DeptCommonCodeTrack", temp, "code", "name"));
		}
		if (mapRow.get("visibleproductlinetype") != null) {
			temp = mapRow.get("visibleproductlinetype").toString();
			mapRow.put("dispvisibleproductlinetype", datacodeCache.getValueDynamic("VisualDeptType", temp, "code", "name"));
		}
		if (mapRow.get("visibleproductlinerange") != null) {
			temp = mapRow.get("visibleproductlinerange").toString();
			mapRow.put("dispvisibleproductlinerange", datacodeCache.getValueDynamic("ProductLine", temp, "code", "name"));
		}
		if (mapRow.get("novisiblecommoncodetype") != null) {
			temp = mapRow.get("novisiblecommoncodetype").toString();
			mapRow.put("dispnovisiblecommoncodetype", datacodeCache.getValueDynamic("VisualDeptType", temp, "code", "name"));
		}
		if (mapRow.get("novisiblecommoncoderange") != null) {
			temp = mapRow.get("novisiblecommoncoderange").toString();
			mapRow.put("dispnovisiblecommoncoderange", datacodeCache.getValueDynamic("DeptCommonCodeTrack", temp, "code", "name"));
		}
		if (mapRow.get("novisibleproductlinetype") != null) {
			temp = mapRow.get("novisibleproductlinetype").toString();
			mapRow.put("dispnovisibleproductlinetype", datacodeCache.getValueDynamic("VisualDeptType", temp, "code", "name"));
		}
		if (mapRow.get("novisibleproductlinerange") != null) {
			temp = mapRow.get("novisibleproductlinerange").toString();
			mapRow.put("dispnovisibleproductlinerange", datacodeCache.getValueDynamic("ProductLine", temp, "code", "name"));
		}
		if (mapRow.get("whethermust") != null) {
			temp = mapRow.get("whethermust").toString();
			mapRow.put("dispwhethermust", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("enabled") != null) {
			temp = mapRow.get("enabled").toString();
			mapRow.put("dispenabled", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
		if (mapRow.get("whetherdefault") != null) {
			temp = mapRow.get("whetherdefault").toString();
			mapRow.put("dispwhetherdefault", datacodeCache.getValueDynamic("CboYesNo", temp, "code", "name"));
		}
	}

	@Override
	@Resource(name = "mmsPostAuthorizationInfoDao")
	public void setDao(IBasicDao<MmsPostAuthorizationInfoEntity> dao) {
		super.setDao(dao);
	}
}
